<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>${book.name}</title>
</head>
<body>
Book page
<div id="info">
<p>Book name:  ${book.name}</p>
<p>Genre:  <c:forEach items="${book.genre}" var="genre"> ${genre.name} 	</c:forEach></p>
<p>Authors:  <c:forEach items="${book.authors}" var="author"> ${genre.author} 	</c:forEach></p>
<p>Status: 	<c:if test="${book.status == 1}">new</c:if> <c:if test="${book.status == 0}">not published</c:if> <c:if test="${book.status == -1}">old</c:if></p>
<p>Count:  ${book.count}</p>
<p>Price:  ${book.retailPrice}</p>
<p>Likes:  ${book.likedUsers.size()}</p>
</div>

<div id="order1">
		<p>Order this book:</p>
		<form name='orderBook' action="order" method='POST'>
			<input type="hidden" name="bookID" value="${book.id}"/>
			Count: <input required type="text" pattern="^[ 0-9]+$" name="count"><br> 
			Address: <input required type="text" name="address"><br> 
			 Choose the payment method: <select size="1" name="payment">
				<option value="cart">cart</option>
				<option selected value="cash">cash</option>
				<option value="check">check</option>
				<option value="remittance">remittance</option></select>
				<br>
				<input name="submit" type="submit" value=" Create order " />
		</form>
	</div>

</body>
</html>